﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// Adv_UserInfo数据模型对象
    /// </summary>
    [Serializable]
    public partial class Adv_UserInfoMod: IEntity, IEntityTypeBuilder<Adv_UserInfoMod>
    {
        /// <summary>
        /// 初始化Adv_UserInfo数据模型对象
        /// </summary>
        public Adv_UserInfoMod()
        {
            
        }
        /// <summary>
        /// 初始化Adv_UserInfo数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="name">Name</param>
        /// <param name="password">Password</param>
        /// <param name="longi">Longi</param>
        /// <param name="lati">Lati</param>
        /// <param name="oilpwd">oilpwd</param>
        public Adv_UserInfoMod(string id,string name,string password,decimal longi,decimal lati,string oilpwd)
        {
            //给Id字段赋值
            this.Id = id;
            //给Name字段赋值
            this.Name = name;
            //给Password字段赋值
            this.Password = password;
            //给Longi字段赋值
            this.Longi = longi;
            //给Lati字段赋值
            this.Lati = lati;
            //给oilpwd字段赋值
            this.Oilpwd = oilpwd;
        }
        /// <summary>
        /// 初始化Adv_UserInfo数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="name">Name</param>
        /// <param name="password">Password</param>
        /// <param name="deptID">DeptID</param>
        /// <param name="phone">Phone</param>
        /// <param name="fax">Fax</param>
        /// <param name="email">Email</param>
        /// <param name="remark">Remark</param>
        /// <param name="longi">Longi</param>
        /// <param name="lati">Lati</param>
        /// <param name="oilpwd">oilpwd</param>
        public Adv_UserInfoMod(string id,string name,string password,string deptID,string phone,string fax,string email,string remark,decimal longi,decimal lati,string oilpwd)
        {
            //给Id字段赋值
            this.Id = id;
            //给Name字段赋值
            this.Name = name;
            //给Password字段赋值
            this.Password = password;
            //给DeptID字段赋值
            this.DeptID = deptID;
            //给Phone字段赋值
            this.Phone = phone;
            //给Fax字段赋值
            this.Fax = fax;
            //给Email字段赋值
            this.Email = email;
            //给Remark字段赋值
            this.Remark = remark;
            //给Longi字段赋值
            this.Longi = longi;
            //给Lati字段赋值
            this.Lati = lati;
            //给oilpwd字段赋值
            this.Oilpwd = oilpwd;
        }
        
		//属性存储数据的变量
        private string _id;
        private string _name;
        private string _password;
        private string _deptID;
        private string _phone;
        private string _fax;
        private string _email;
        private string _remark;
        private decimal _longi;
        private decimal _lati;
        private string _oilpwd;
        
        /// <summary>
        /// Id
        /// </summary>
        public string Id
        {
            get { return this._id; }
            set { this._id = value; }
        }
        /// <summary>
        /// Name
        /// </summary>
        public string Name
        {
            get { return this._name; }
            set { this._name = value; }
        }
        /// <summary>
        /// Password
        /// </summary>
        public string Password
        {
            get { return this._password; }
            set { this._password = value; }
        }
        /// <summary>
        /// DeptID
        /// </summary>
        public string DeptID
        {
            get { return this._deptID; }
            set { this._deptID = value; }
        }
        /// <summary>
        /// Phone
        /// </summary>
        public string Phone
        {
            get { return this._phone; }
            set { this._phone = value; }
        }
        /// <summary>
        /// Fax
        /// </summary>
        public string Fax
        {
            get { return this._fax; }
            set { this._fax = value; }
        }
        /// <summary>
        /// Email
        /// </summary>
        public string Email
        {
            get { return this._email; }
            set { this._email = value; }
        }
        /// <summary>
        /// Remark
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// Longi
        /// </summary>
        public decimal Longi
        {
            get { return this._longi; }
            set { this._longi = value; }
        }
        /// <summary>
        /// Lati
        /// </summary>
        public decimal Lati
        {
            get { return this._lati; }
            set { this._lati = value; }
        }
        /// <summary>
        /// oilpwd
        /// </summary>
        public string Oilpwd
        {
            get { return this._oilpwd; }
            set { this._oilpwd = value; }
        }

        public void Configure(EntityTypeBuilder<Adv_UserInfoMod> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            {
                entityBuilder.ToTable("Adv_UserInfo");
                entityBuilder.HasComment("用户对象");
                entityBuilder.HasKey(e => e.Id);
            }
        }

        /// <summary>
        /// 对比两个Adv_UserInfo数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的Adv_UserInfo数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成Adv_UserInfo数据模型对象
            Adv_UserInfoMod adv_UserInfoMod = obj as Adv_UserInfoMod;
            //判断是否转换成功
            if (adv_UserInfoMod == null) return false;
            //进行匹配属性的值
            return
                //判断Id是否一致
                this.Id == adv_UserInfoMod.Id &&
                //判断Name是否一致
                this.Name == adv_UserInfoMod.Name &&
                //判断Password是否一致
                this.Password == adv_UserInfoMod.Password &&
                //判断DeptID是否一致
                this.DeptID == adv_UserInfoMod.DeptID &&
                //判断Phone是否一致
                this.Phone == adv_UserInfoMod.Phone &&
                //判断Fax是否一致
                this.Fax == adv_UserInfoMod.Fax &&
                //判断Email是否一致
                this.Email == adv_UserInfoMod.Email &&
                //判断Remark是否一致
                this.Remark == adv_UserInfoMod.Remark &&
                //判断Longi是否一致
                this.Longi == adv_UserInfoMod.Longi &&
                //判断Lati是否一致
                this.Lati == adv_UserInfoMod.Lati &&
                //判断oilpwd是否一致
                this.Oilpwd == adv_UserInfoMod.Oilpwd;
        }
        /// <summary>
        /// 将当前Adv_UserInfo数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将Adv_UserInfo数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将Id进行按位异或运算处理
                (this.Id == null ? 2147483647 : this.Id.GetHashCode()) ^
                //将Name进行按位异或运算处理
                (this.Name == null ? 2147483647 : this.Name.GetHashCode()) ^
                //将Password进行按位异或运算处理
                (this.Password == null ? 2147483647 : this.Password.GetHashCode()) ^
                //将DeptID进行按位异或运算处理
                (this.DeptID == null ? 2147483647 : this.DeptID.GetHashCode()) ^
                //将Phone进行按位异或运算处理
                (this.Phone == null ? 2147483647 : this.Phone.GetHashCode()) ^
                //将Fax进行按位异或运算处理
                (this.Fax == null ? 2147483647 : this.Fax.GetHashCode()) ^
                //将Email进行按位异或运算处理
                (this.Email == null ? 2147483647 : this.Email.GetHashCode()) ^
                //将Remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将Longi进行按位异或运算处理
                this.Longi.GetHashCode() ^
                //将Lati进行按位异或运算处理
                this.Lati.GetHashCode() ^
                //将oilpwd进行按位异或运算处理
                (this.Oilpwd == null ? 2147483647 : this.Oilpwd.GetHashCode());
        }
        /// <summary>
        /// 将当前Adv_UserInfo数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前Adv_UserInfo数据模型对象转换成字符串副本
            return
                "[" +
                //将Id转换成字符串
                this.Id + "," +
                //将Name转换成字符串
                this.Name + "," +
                //将Password转换成字符串
                this.Password + "," +
                //将Longi转换成字符串
                this.Longi + "," +
                //将Lati转换成字符串
                this.Lati + "," +
                //将oilpwd转换成字符串
                this.Oilpwd +
                "]";
        }
    }
}
